﻿@model IEnumerable<shop.Entity.ShoppingCart>
@{
    ViewBag.Title = "Cart";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="container">
 
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3>Thông tin giỏ hàng</h3>
        </div>
        <div class="panel-body">
            <table class="table table-striped table-condensed table-bordered" style="color:#00ff21;">
                <tr style="color:#808080;">
                    <th class="text-right">Mã sản phẩm</th>
                    <th>Tên</th>
                    <th class="text-center">Hình</th>
                    <th class="text-right">Số lượng</th>
                    <th class="text-center">Giá</th>
                    <th class="text-center">Actions</th>
                </tr>
             @foreach (var p in shop.Entity.ShoppingCart.Instance.Products)
             { 
             <tr>
                 <td>@p.ProductID</td>
                 <td>@p.ProductName</td>
                 <td><img src="~/images/sanpham/@p.Image" height="70px" width="70px" /></td>
                 <td>
                     <button type="button" class="btn btn-primary" onclick="location.href = '@Url.Action("Clear", "Cart",  null)'">-</button>
                 <input type="text" value="@p.Quantity" style="height:10px;width:10px; padding-top:5px;"/>
                 <button type="button" class="btn btn-primary" onclick="location.href = '@Url.Action("Clear", "Cart",  null)'">+</button>
                 </td>
                 <td>@p.ThanhTien</td>
                 
                 <td><button type="button" class="btn btn-primary" onclick="location.href = '@Url.Action("Delete", "Cart", new { idnum = p.ProductID }, null)'">Xoa</button></td>
             </tr>
             }
                <tr>
                    <td colspan="2"><button type="button" class="btn btn-primary" onclick="location.href = '@Url.Action("Clear", "Cart",  null)'">Xoa hết</button></td>
                    <td colspan="3">Tổng tiền</td>
                    <td>@shop.Entity.ShoppingCart.Instance.TongThanhTien() VND</td>
                </tr>
            </table>
            <div class="form-group pull-center">
                <button type="button" class="btn btn-primary" onclick="location.href = '@Url.Action("Index", "Home",  null)'">Tiếp tục mua hàng</button>

                <!-- Indicates a successful or positive action -->
                <button type="button" class="btn btn-success">Sửa giỏ hàng</button>

                <!-- Contextual button for informational alert messages -->
                <button type="button" class="btn btn-info">thanh toán</button>

            </div>
        </div>
       
    </div>
</div>